Ext.ns('Wlanauth.system');
/**
 * 暂时未用
 */
Wlanauth.system.StatusPanel = Ext.extend(Ext.Panel,{
	title:'系统状态',
	padding:10,
	constructor:function(config){
		Ext.applyIf(this,config);
	 	
		var commonInfoPanel = new Wlanauth.BaseFormPanel({
			columnWidth:.4,
			defaults:{xtype:'displayfield',anchor:'95%',cls:'x-field-display',value:'&nbsp;'},
			items:[{
				fieldLabel:'操作系统',
				name:'os.name',
				value:'&nbsp;'
			},{
				fieldLabel:'操作系统架构',
				name:'os.arch'
			},{
				fieldLabel:'操作系统版本',
				name:'os.version'
			},{
				fieldLabel:'时区',
				name:'user.timezone'
			}]
		});
		var store = new Ext.data.JsonStore({
	        fields:['name', 'visits', 'views'],
	        data: [
	            {name:'Jul 07', visits: 245000, views: 3000000},
	            {name:'Aug 07', visits: 240000, views: 3500000},
	            {name:'Sep 07', visits: 355000, views: 4000000},
	            {name:'Oct 07', visits: 375000, views: 4200000},
	            {name:'Nov 07', visits: 490000, views: 4500000},
	            {name:'Dec 07', visits: 495000, views: 5800000},
	            {name:'Jan 08', visits: 520000, views: 6000000},
	            {name:'Feb 08', visits: 620000, views: 7500000}
	        ]
	    });
		
		Wlanauth.system.StatusPanel.superclass.constructor.call(this,{
			width:500,
	        height:300,
	        layout:'column',
	       
	        bodyStyle:'background-image:url(../images/welcome.jpg) ',
	    	items: [{
	        	columnWidth:.56,
	            xtype: 'linechart',
	            store: store,
	            xField: 'name',
	            yField: 'visits',
	            height:500,
	            ctCls : 'ex-panel',
	            
	            bodyStyle:'background-color:#F00000',
				listeners: {
					itemclick: function(o){
						var rec = store.getAt(o.index);
						Ext.example.msg('Item Selected', 'You chose {0}.', rec.get('name'));
					}
				}
	        },commonInfoPanel]
			
		});
		
		commonInfoPanel.load({
			url:'system!fetchCurrentStatus.action'
		});
	}
});

Ext.reg('wlanauth.system.statuspanel',Wlanauth.system.StatusPanel);